/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils.observer.login;

import java.util.ArrayList;
import utils.observer.Observer;
import utils.observer.Subject;

/**
 *
 * @author Amauri
 */
public class UsuarioSubject implements Subject {

    private ArrayList<Observer> observers;

    public UsuarioSubject() {
        observers = new ArrayList<>();
    }
    
    @Override
    public void notifyObservers() {
        for(Observer o: this.observers){
            o.update();
        }
    }

    @Override
    public void registerObserver(Observer o) {
        this.observers.add(o);
    }

    @Override
    public void removeObserver(Observer o) {
        this.observers.remove(o);
    }
}